Catering to all possible routes for Post Request#700
Conversation
|
@DeepanshuA Please see to the indentation ... Viewing via GitHub is hard ... please check if the checkstyle passes locally ... |
1 similar comment
|
@DeepanshuA Please see to the indentation ... Viewing via GitHub is hard ... please check if the checkstyle passes locally ... |
mukundansundar
left a comment
There was a problem hiding this comment.
lgtm. @DeepanshuA Can you look into adding Unit Tests for the same?
|
@DeepanshuA |
yeah @mukundansundar, fixed indentation |
fixed indentation |
yups, added, was in WIP actually before this |
yeah @mukundansundar, missed out on sign-off part, let me fix it; yeah, will change the title - it will be PR complete after DCO change. |
Signed-off-by: deepanshuagarwal <deepanshu.agarwal1984@gmail.com>
Signed-off-by: deepanshuagarwal <deepanshu.agarwal1984@gmail.com>
Signed-off-by: deepanshuagarwal <deepanshu.agarwal1984@gmail.com>
Signed-off-by: deepanshuagarwal <deepanshu.agarwal1984@gmail.com>
|
cc @artursouza |
| * @param topicName Associated topic name | ||
| * @return All possible routes for post mapping for this class and post method | ||
| */ | ||
| public static List<String> getAllCompleteRoutesForPost(Class clazz, Method method, String topicName) { |
There was a problem hiding this comment.
Please, move this as a private method in DaprBeanPostProcessor. The reason is that this design will make this method public and part of our contract - in other words, users can depend on this method. Marking it as private makes it clear that is internal use only. Unfortunately, we don't have an internal visibility, only protected, public, private and default.
There was a problem hiding this comment.
Agreed that this will expose it without need of exposing. Though, just thinking that at least taking out some methods with default access (package private)/ protected may be required, if refactoring a huge class OR using a required design pattern may force us making some extra methods/interfaces public sometimes. BUT, that's not the case with DaprBeanPostProcessor as of now. So, making the suggested change.
|
|
||
| @Test | ||
| public void testAllPostRoutesGeneration() throws NoSuchMethodException { | ||
| List<String> routesArrayTestMethod1 = SpringProcessorHelper.getAllCompleteRoutesForPost(clazzToBeTested, |
There was a problem hiding this comment.
After this method is made private, you can still test it via reflection.
Signed-off-by: deepanshuagarwal <deepanshu.agarwal1984@gmail.com>
Codecov Report
@@ Coverage Diff @@
## master #700 +/- ##
============================================
- Coverage 79.62% 78.10% -1.53%
- Complexity 1092 1106 +14
============================================
Files 92 97 +5
Lines 3308 3407 +99
Branches 376 394 +18
============================================
+ Hits 2634 2661 +27
- Misses 482 547 +65
- Partials 192 199 +7
Continue to review full report at Codecov.
|
* Catering to all possible routes for Post Request Signed-off-by: deepanshuagarwal <deepanshu.agarwal1984@gmail.com> * Correcting checkstyle related violations Signed-off-by: deepanshuagarwal <deepanshu.agarwal1984@gmail.com> * Refactoring and Adding UTs for post method routes Signed-off-by: deepanshuagarwal <deepanshu.agarwal1984@gmail.com> * Using resolved topic name Signed-off-by: deepanshuagarwal <deepanshu.agarwal1984@gmail.com> * Shifting routesPostMethod to reduce its access Signed-off-by: deepanshuagarwal <deepanshu.agarwal1984@gmail.com> Co-authored-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com> Signed-off-by: zjx244729 <zjx244729@alibaba-inc.com>
* Catering to all possible routes for Post Request Signed-off-by: deepanshuagarwal <deepanshu.agarwal1984@gmail.com> * Correcting checkstyle related violations Signed-off-by: deepanshuagarwal <deepanshu.agarwal1984@gmail.com> * Refactoring and Adding UTs for post method routes Signed-off-by: deepanshuagarwal <deepanshu.agarwal1984@gmail.com> * Using resolved topic name Signed-off-by: deepanshuagarwal <deepanshu.agarwal1984@gmail.com> * Shifting routesPostMethod to reduce its access Signed-off-by: deepanshuagarwal <deepanshu.agarwal1984@gmail.com> Co-authored-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com> Signed-off-by: zjx244729 <zjx244729@alibaba-inc.com>
* Catering to all possible routes for Post Request Signed-off-by: deepanshuagarwal <deepanshu.agarwal1984@gmail.com> * Correcting checkstyle related violations Signed-off-by: deepanshuagarwal <deepanshu.agarwal1984@gmail.com> * Refactoring and Adding UTs for post method routes Signed-off-by: deepanshuagarwal <deepanshu.agarwal1984@gmail.com> * Using resolved topic name Signed-off-by: deepanshuagarwal <deepanshu.agarwal1984@gmail.com> * Shifting routesPostMethod to reduce its access Signed-off-by: deepanshuagarwal <deepanshu.agarwal1984@gmail.com> Co-authored-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com> Signed-off-by: zjx244729 <zjx244729@alibaba-inc.com>
* Catering to all possible routes for Post Request Signed-off-by: deepanshuagarwal <deepanshu.agarwal1984@gmail.com> * Correcting checkstyle related violations Signed-off-by: deepanshuagarwal <deepanshu.agarwal1984@gmail.com> * Refactoring and Adding UTs for post method routes Signed-off-by: deepanshuagarwal <deepanshu.agarwal1984@gmail.com> * Using resolved topic name Signed-off-by: deepanshuagarwal <deepanshu.agarwal1984@gmail.com> * Shifting routesPostMethod to reduce its access Signed-off-by: deepanshuagarwal <deepanshu.agarwal1984@gmail.com> Co-authored-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com> Signed-off-by: zjx244729 <zjx244729@alibaba-inc.com>
* Catering to all possible routes for Post Request Signed-off-by: deepanshuagarwal <deepanshu.agarwal1984@gmail.com> * Correcting checkstyle related violations Signed-off-by: deepanshuagarwal <deepanshu.agarwal1984@gmail.com> * Refactoring and Adding UTs for post method routes Signed-off-by: deepanshuagarwal <deepanshu.agarwal1984@gmail.com> * Using resolved topic name Signed-off-by: deepanshuagarwal <deepanshu.agarwal1984@gmail.com> * Shifting routesPostMethod to reduce its access Signed-off-by: deepanshuagarwal <deepanshu.agarwal1984@gmail.com> Co-authored-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com> Signed-off-by: zjx244729 <zjx244729@alibaba-inc.com>
* Catering to all possible routes for Post Request Signed-off-by: deepanshuagarwal <deepanshu.agarwal1984@gmail.com> * Correcting checkstyle related violations Signed-off-by: deepanshuagarwal <deepanshu.agarwal1984@gmail.com> * Refactoring and Adding UTs for post method routes Signed-off-by: deepanshuagarwal <deepanshu.agarwal1984@gmail.com> * Using resolved topic name Signed-off-by: deepanshuagarwal <deepanshu.agarwal1984@gmail.com> * Shifting routesPostMethod to reduce its access Signed-off-by: deepanshuagarwal <deepanshu.agarwal1984@gmail.com> Co-authored-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
Signed-off-by: deepanshuagarwal deepanshu.agarwal1984@gmail.com
Description
A topic is getting subscribed to in Dapr with a truncated path, in case a class level RequestMapping is also provided with PostMapping path. This change aims at fixing this by taking into account all paths possible for POST.
Issue reference
Please reference the issue this PR will close: #694
Checklist
Please make sure you've completed the relevant tasks for this PR, out of the following list: